/**
 * Created by dev-001 on 2017/04/06.
 */
import mongoose from 'mongoose';
import {PointSchema} from '../biz/point';
const Schema = mongoose.Schema;

const ObjectId = Schema.Types.ObjectId;

const TextBookSchema = new Schema({
    name: String,//新课标人教版-必修1
    textBook: {
        type: ObjectId,
        ref: 'TextBook'
    },
    level: Number,
    createdAt: Date,
    updatedAt: Date
});

TextBookSchema.pre('save', function (next) {
    this.createdAt = new Date();
    next();
});


export default mongoose.model('TextBook', TextBookSchema);